import javax.swing.*;
import java.awt.*;

public class Graph extends JDialog
{
	private JLabel nom;
	private JLabel prenom;
	private JLabel dateNaissance;
	private JTextField texteNom;
	private JTextField textePrenom;
	private JTextField texteDateNaissance;
	private JLabel sexe;
	private JLabel nationalite;
	private JLabel loisirs;
	private JRadioButton f;
	private JRadioButton m;
	private Container contenu;
	private JComboBox nationaliteTexte;
	private String[] choixNationalite = { "Francais", "Anglais", "Allemand", "Espagnol", "Italien" };
	private JCheckBox loisir1;
	private JCheckBox loisir2;
	private JCheckBox loisir3;
	private JCheckBox loisir4;
	private ButtonGroup btg;
	private JButton ok;
	private JButton annule;
	
	
	private JPanel panelNomPrenomDate;
	private JPanel panelNationalite;
	private JPanel panelSexe;
	private JPanel panelLoisirs;
	private JPanel panelOkAnnule;
	
	public Graph()
	{
		super();
		
		this.setTitle("Fiche client");
		this.nom = new JLabel("Nom");
		this.texteNom=new JTextField();
		this.prenom = new JLabel("Prenom");
		this.textePrenom=new JTextField();
		this.dateNaissance = new JLabel("Date de naissance");
		this.texteDateNaissance=new JTextField();
		this.sexe = new JLabel("Sexe");
		this.f=new JRadioButton("F");
		this.m=new JRadioButton("M");
		this.nationalite = new JLabel("Nationalite");
		this.nationaliteTexte=new JComboBox(choixNationalite);
		this.nationaliteTexte.setMaximumRowCount(2);
		this.loisirs = new JLabel("Loisirs");
		this.loisir1= new JCheckBox("Sport");
		this.loisir2= new JCheckBox("Cinema");
		this.loisir3= new JCheckBox("Theatre");
		this.loisir4= new JCheckBox("Lecture");
		this.btg= new ButtonGroup();
		this.ok = new JButton();
		this.annule = new JButton();
		
		this.panelNomPrenomDate = new JPanel();
		this.panelNationalite = new JPanel();
		this.panelSexe = new JPanel();
		this.panelLoisirs = new JPanel();
		this.panelOkAnnule = new JPanel();
		
		
		this.contenu = this.getContentPane();
		this.contenu.add(this.panelNomPrenomDate);
		this.contenu.add(this.panelNationalite);
		this.contenu.add(this.panelSexe);
		this.contenu.add(this.panelLoisirs);
		this.contenu.add(this.panelOkAnnule);
		this.btg.add(this.f);
		this.btg.add(this.m);
		this.contenu.add(this.sexe);
		this.contenu.add(this.loisirs);
		this.contenu.setLayout(null);
		this.panelNomPrenomDate.setBounds(20,10,270,100);
		this.panelNationalite.setBounds(20,150,270,20);
		this.panelSexe.setBounds(150,115,130,20);
		this.panelLoisirs.setBounds(50,220,270,50);
		this.panelOkAnnule.setBounds(0,300,400,50);
		
		
		this.panelNomPrenomDate.add(this.nom);
		this.panelNomPrenomDate.add(this.texteNom);
		this.panelNomPrenomDate.add(this.prenom);
		this.panelNomPrenomDate.add(this.textePrenom);
		this.panelNomPrenomDate.add(this.dateNaissance);
		this.panelNomPrenomDate.add(this.texteDateNaissance);
		this.sexe.setBounds(20,115,100,25);
		this.panelSexe.add(this.f);
		this.panelSexe.add(this.m);
		this.panelNationalite.add(this.nationalite);
		this.panelNationalite.add(this.nationaliteTexte);
		this.loisirs.setBounds(20,190,100,25);
		this.panelLoisirs.add(this.loisir1);
		this.panelLoisirs.add(this.loisir2);
		this.panelLoisirs.add(this.loisir3);
		this.panelLoisirs.add(this.loisir4);
		this.panelOkAnnule.add(this.ok);
		this.panelOkAnnule.add(this.annule);
		this.ok.setText("Ok");
		this.ok.setVerticalTextPosition(SwingConstants.CENTER);
		this.ok.setHorizontalTextPosition(SwingConstants.CENTER);
		this.annule.setText("Annuler");
		this.annule.setVerticalTextPosition(SwingConstants.CENTER);
		this.annule.setHorizontalTextPosition(SwingConstants.CENTER);
		
		panelNomPrenomDate.setLayout(new GridLayout(3,2,20,20));
		panelNationalite.setLayout(new GridLayout(1,2));
		panelSexe.setLayout(new FlowLayout(FlowLayout.CENTER,20,1));
		panelLoisirs.setLayout(new GridLayout(2,2));
		panelOkAnnule.setLayout(new FlowLayout(FlowLayout.CENTER,20,1));
		
		
		this.setBounds(50,50,340,400);
		this.setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE);
		this.setResizable(false);
	}
}